<template>
  <div>
    <div v-for="(item, index) in todos" :key="index">
      <ToDoItem :todo="item" @complete="complete(index)"/>
    </div>
  </div>
</template>

<script>
import ToDoItem from '@/components/ToDoList/ToDoItem'
export default {
  name: 'to-do-body',
  components: {
    ToDoItem
  },
  props: {
    todos: {
      required: true,
      type: Array
    }
  },
  methods: {
    complete (index) {
      this.$emit('complete', index)
    }
  }
}
</script>

<style>

</style>
